itle: “Dashboards I”
uthor: "Reporting mit R
The R Bootcamp

"
ate: “Februar 2021”
utput:
xaringan::moon_reader:
css: [“default”, “baselrbootcamp.css”]
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
ratio: ‘16:9’

layout: true


Was sind Dashboards?

.pull-left4[

]

.pull-right5[


from towardsdatascience.com

]


Ein Beispiel


from rstudio.com


Ein Beispiel


from therbootcamp.com


Layout

.pull-left4[

]

.pull-right5[

]


Seiten

.pull-left4[
Seite 1
====================================
  
Seite 2
====================================

]

.pull-right5[

]


Spalten

.pull-left4[
Seite 1
====================================
  
Spalte 1
------------------------------------
  
Spalte 2
------------------------------------

]

.pull-right5[

]


Blöcke

.pull-left4[
Seite 1
====================================
  
Spalte 1
------------------------------------
  
### Inhalt 1

  
Spalte 2
------------------------------------
  
### Inhalt 2
  
### Inhalt 3

]

.pull-right5[

]


Spaltenbreite

.pull-left4[
Seite 1
====================================
  
Spalte 1 {data-width = 700}
------------------------------------
  
### Inhalt 1

```{r fig.width = 9}
hist(basel$einkommen)
```
  
Spalte 2
------------------------------------
  
### Inhalt 2
  
### Inhalt 3

]

.pull-right5[

]


Storyboard

.pull-left4[
Seite 1 {.storyboard}
====================================
  
### Inhalt 1

Hauptinhalt
  
 ***
  
Kommentar

### Inhalt 2

]

.pull-right5[

]


Komponenten

.pull-left4[

]

.pull-right5[

]


valueBox

.pull-left5[

# Ergänze valueBox
valueBox(WERT,
         caption = "TITEL",
         icon = "ICON",
         color = "FARBE")

]

.pull-right4[


]


gauge

.pull-left5[

# Ergänze gauge
gauge(WERT, min = MIN, max = MAX,
      gaugeSectors(
        success = c(MIN_S, MAX),
        warning = c(MIN_W, MAX_W),
        danger = c(MIN, MAX_D)
      ))

]

.pull-right4[

]


gauge

.pull-left5[

# Ergänze gauge
gauge(round(mean(basel$glueck), 2),
      min = 1, max = 10,
      gaugeSectors(
        success = c(8, 10),
        warning = c(5, 7),
        danger = c(0, 4)
        ))

]

.pull-right4[

]


htmlwidgets: leaflet

.pull-left45[

# Initiiere leaflet
leaflet() %>% 
  # Setze Anfangskoordinaten und Zoomwert
  setView(lng = 7.5885761,
          lat = 47.5595986,
          zoom = 15) %>% 
  # Zeichne Karte
  addTiles()

]

.pull-right45[

]


htmlwidgets: leaflet

.pull-left45[

# Initiiere leaflet
leaflet() %>% 
  # Setze Anfangskoordinaten und Zoomwert
  setView(lng = 7.5885761,
          lat = 47.5595986,
          zoom = 15) %>% 
  # Zeichne Karte
  addTiles() %>% 
  # Zeichne Marker
  addCircleMarkers(
    lng = 7.589263051748261,
    lat = 47.55892108771642)

]

.pull-right45[

]


htmlwidgets: leaflet

.pull-left45[

# Initiiere leaflet
leaflet() %>% 
  # Setze Anfangskoordinaten und Zoomwert
  setView(lng = 7.5885761,
          lat = 47.5595986,
          zoom = 15) %>% 
  # Zeichne Karte
  addTiles() %>% 
  # Zeichne Marker
  addAwesomeMarkers(
    lng = 7.589263051748261,
    lat = 47.55892108771642,
    icon = awesomeIcons(
          icon = "university",
          library = "fa"))

]

.pull-right45[

]


htmlwidgets: plotly

.pull-left45[

p <- ggplot(basel,
            aes(alter, arztbesuche,
                col = geschlecht)) + 
  geom_point(alpha = .2) +
  geom_smooth() +
  theme_light()
  
ggplotly(p)

]

.pull-right45[

]


class: middle, center

Practical